<div class="order-state-wrap">
  订单状态: &nbsp;
  <span [ngStyle]="{'color': orderDetailsData.ostat | orderState: 'color'}">
    {{ orderDetailsData.ostat | orderState: 'text' }}
  </span>
</div>

<!-- 订单动态 START -->
<nz-card [nzSize]="cardSize" class="m-b-2">
  <p class="card-p">订单动态</p>

  <nz-timeline class="dynamic-wrap" *ngIf="orderDynamic.length;else templateDynamic">
    <ng-container *ngFor="let item of orderDynamic">
      <nz-timeline-item>
        <p class="dynamic-p">
          <!-- <b>{{ item.text }}</b> -->
          <span>
            {{ item.text }}
            <button *ngIf="item.process" nz-button nzType="link" (click)="showLogisticsModal(item.process)">查看物流详情</button>
          </span>
          <span class="time">{{ item.time || '----' }}</span>
        </p>
      </nz-timeline-item>
    </ng-container>
  </nz-timeline>
  <ng-template #templateDynamic>
    <nz-empty></nz-empty>
  </ng-template>
</nz-card>
<!-- 订单动态 END -->

<!-- 订单信息 START -->
<nz-card [nzSize]="cardSize" class="m-b-2">
  <nz-descriptions
    [nzBordered]="true"
    nzSize="small"
    [nzTitle]="canceTitle"
    [nzExtra]="cancelTpl"
    [nzColumn]="{ xxl: 4, xl: 3, lg: 3, md: 3, sm: 2, xs: 1 }">
    <nz-descriptions-item nzTitle="订单编号">{{ orderDetailsData.okey || '-' }}</nz-descriptions-item>
    <nz-descriptions-item nzTitle="订单来源">
      <ng-container *ngIf="orderDetailsData.platform;else templatePlatform">
        <nz-tag [nzColor]="'blue'">
          {{ filterPlatform(orderDetailsData.platform) }}
        </nz-tag>
      </ng-container>
      <ng-template #templatePlatform>-</ng-template>
    </nz-descriptions-item>
    <nz-descriptions-item nzTitle="订单状态">
      <span [ngStyle]="{'color': orderDetailsData.ostat | orderState: 'color'}">
        {{ orderDetailsData.ostat | orderState: 'text' }}
      </span>
    </nz-descriptions-item>
    <nz-descriptions-item nzTitle="用户身份">
      <ng-container *ngIf="orderDetailsData?.userId && orderDetailsData?.userId != 0;else templateSf">
        <button nz-button nzType="link" (click)="userInfoPreview()">爱思用户</button>
      </ng-container>
      <ng-template #templateSf>游客</ng-template>
    </nz-descriptions-item>

    <nz-descriptions-item nzTitle="下单方式">
      <span [ngStyle]="{'color': orderDetailsData.orderWay == 2 ? '#FF9933' : ''}">
        {{ orderDetailsData.orderWay == 1 ? '估价下单' : orderDetailsData.orderWay == 2 ? '批量下单' : orderDetailsData.orderWay == 3 ? '快速下单' : '-' }}
      </span>
    </nz-descriptions-item>
    <nz-descriptions-item nzTitle="下单时间">{{ orderDetailsData.otime11 || '-' }}</nz-descriptions-item>
    <nz-descriptions-item nzTitle="成交时间">{{ orderDetailsData.otime19 || '-' }}</nz-descriptions-item>
    <nz-descriptions-item nzTitle="更新时间">{{ orderDetailsData.updateTime || '-' }}</nz-descriptions-item>
  </nz-descriptions>

  <ng-template #canceTitle>
    <span>订单信息</span>
    <button
      *ngIf="permission.userPermission.has('aisi-recyc:loveOrderManage:closeOrder') && ![22,23,24,25].includes(orderDetailsData.ostat)"
      nz-button
      nzType="primary"
      nzDanger
      nzSize="small"
      class="m-l-10"
      (click)="showcloseOrder()"
    >关闭订单</button>
  </ng-template>

  <ng-template #cancelTpl>
    <ng-container *ngIf="orderDetailsData.ostat == 11">
      <button nz-button nzType="link" (click)="showOrderCancel()">取消订单</button>
    </ng-container>
  </ng-template>
</nz-card>
<!-- 订单信息 END -->

<!-- 寄件信息 START -->
<nz-card [nzSize]="cardSize" class="m-b-2">
  <nz-descriptions
    [nzTitle]="mailTitle"
    [nzBordered]="true"
    nzSize="small"
    [nzColumn]="{ xxl: 4, xl: 3, lg: 3, md: 3, sm: 2, xs: 1 }">
    <ng-template #mailTitle>
      <span>寄件信息</span>
      <button
        nz-button
        nzType="primary"
        nzDanger
        nzSize="small"
        class="m-l-10"
        (click)="showSendMessageModal()"
      >发送短信</button>
    </ng-template>

    <nz-descriptions-item nzTitle="寄件人姓名">{{ orderDetailsData.lnker || '-' }}</nz-descriptions-item>
    <nz-descriptions-item nzTitle="联系电话">{{ orderDetailsData.lnktel || '-' }}</nz-descriptions-item>
    <nz-descriptions-item nzTitle="取件时间" [nzSpan]="2">{{ orderDetailsData.apptime || '-' }}</nz-descriptions-item>
    
    <nz-descriptions-item nzTitle="取件地址" [nzSpan]="4">{{ orderDetailsData.exparea || '' }} {{ orderDetailsData.expdtl || '' }}</nz-descriptions-item>
    <nz-descriptions-item nzTitle="平台地址" [nzSpan]="4">
      <!-- {{ orderDetailsData.backExparea || '-' }} {{ orderDetailsData.backLnker || '-' }} {{ orderDetailsData.backLnktel || '-' }} -->
      -
    </nz-descriptions-item>
  </nz-descriptions>
</nz-card>
<!-- 寄件信息 END -->

<!-- 收款信息 START -->
<nz-card [nzSize]="cardSize" class="m-b-2">
  <nz-descriptions
    nzTitle="收款信息"
    [nzBordered]="false"
    nzSize="small"
    [nzExtra]="extraTpl"
    [nzColumn]="{ xxl: 4, xl: 3, lg: 3, md: 3, sm: 2, xs: 1 }">
    <nz-descriptions-item nzTitle="账户类型">
      {{ orderDetailsData.payway == '111' ? '微信' : orderDetailsData.payway == '121' ? '支付宝' : '-' }}
    </nz-descriptions-item>
    <nz-descriptions-item nzTitle="收款账号">{{ orderDetailsData.payacc || '-' }}</nz-descriptions-item>
    <nz-descriptions-item nzTitle="收款人姓名">{{ orderDetailsData.payname || '-' }}</nz-descriptions-item>
  </nz-descriptions>
  <ng-template #extraTpl>
    <button nz-button nzType="link" (click)="showCollectionModal()">{{ orderDetailsData.payacc ? '修改' : '添加' }}</button>
  </ng-template>

  <!-- 待打款状态显示 -->
  <div class="collection-opera" *ngIf="[16, 18].includes(orderDetailsData.ostat)">
  <!-- <div class="collection-opera"> -->
    <button nz-button nzType="default" nzDanger (click)="showPaymentModal()">打款失败</button>
    <button nz-button nzType="primary" class="m-l-10" (click)="paymentOperation(1)">打款完成</button>
  </div>
</nz-card>
<!-- 收款信息 END -->

<!-- 机器评估详情 START -->
<nz-card [nzSize]="cardSize" class="m-b-2">
  <p class="card-p">机器评估详情</p>

  <div class="assess-wrap">
    <div class="assess-lf">
      <dl class="assess-info">
        <dt>
          <img
            nz-image
            width="102px"
            height="102px"
            [nzSrc]="[1, 3].includes(orderDetailsData.orderWay) ? (orderDetailsData?.umimgsrc || fallback) : batchDefaultImg"
            alt=""
          />
        </dt>
        <dd>
          <p>
            下单机型：
            <ng-container *ngIf="[1, 3].includes(orderDetailsData.orderWay);else templateXq">
              {{ orderDetailsData.umname || '-' }}
              <i
                nz-icon
                nzType="copy"
                nzTheme="outline"
                nz-tooltip
                nzTooltipTitle="点击复制"
                (click)="copyText(orderDetailsData.umname)"
              ></i>
            </ng-container>
            <ng-template #templateXq>{{ orderDetailsData.umname || '--' }}</ng-template>
          </p>
          <p *ngIf="[1, 3].includes(orderDetailsData.orderWay)">
            评估情况：
            <ng-container *ngFor="let item of situationLists">
              <nz-tag nzColor="success">
                <i nz-icon nzType="check-circle"></i>
                <span>{{ item.oname }}</span>
              </nz-tag>
            </ng-container>
            <!-- <button nz-button nzType="link" (click)="assessPreview()">查看</button> -->
          </p>
        </dd>
      </dl>
    </div>

    <div class="assess-rt" *ngIf="[1, 3].includes(orderDetailsData.orderWay); else elseCjTemplate">
      <p>评估价：{{ orderDetailsData.uprc || '0' }}</p>
      <p>加价：{{ orderDetailsData.orderAprc || '0' }}</p>
      <p>下单抽奖：{{ orderDetailsData.cprc || '0' }}</p>
      <p>合计：<b>{{ (orderDetailsData.uprc || 0) + (orderDetailsData.orderAprc || 0) + (orderDetailsData.cprc || 0) }}</b></p>
    </div>
    <ng-template #elseCjTemplate>
      <div class="assess-rt">
        <p><b>下单抽奖：</b>{{ orderDetailsData.cprc || '0' }}</p>
      </div>
    </ng-template>
  </div>
</nz-card>
<!-- 机器评估详情 END -->

<!-- 机器验机详情 START -->
<nz-card [nzSize]="cardSize" class="m-b-2">
  <p class="card-p">
    机器验机详情
    <span class="result-sp">
      <button
        nz-button
        nzType="link"
        nzSize="small"
        class="m-r-10"
        (click)="showMakeupModal()"
      >加价设置</button>

      <!-- 加价设置 Modal -->
      <makeup-setup-modal
        [(ngModel)]="makeupVisible"
        [otherParams]="{
          id: orderDetailsData?.id,
          userId: orderDetailsData?.userId
        }"
        [setupDisabled]="!machineDetailsTable?.length || ![15, 18, 21].includes(orderDetailsData?.ostat)"
        (submitSetup)="submitSetupCoupon($event)"
      ></makeup-setup-modal>

      验机结果：{{ orderDetailsData.restype | machineResult }}
    </span>
  </p>

  <div class="table-test">
    <nz-table
      #basicTable
      nzSize="small"
      nzBordered
      [nzFrontPagination]="false"
      [nzShowPagination]="false"
      [nzData]="machineDetailsTable">
      <thead>
        <tr>
          <th nzAlign="center">机器编号</th>
          <th nzAlign="center">机器型号</th>
          <th nzAlign="center">验机状态</th>
          <th nzAlign="center">原因</th>
          <th nzAlign="center">验机价</th>
          <th nzAlign="center">加价金额</th>
          <th nzAlign="center">更新时间</th>
          <th nzAlign="center">操作</th>
        </tr>
      </thead>
      <tbody>
        <ng-container *ngFor="let data of basicTable.data">
          <tr>
            <td nzAlign="center">{{ data.phoneCode || '-' }}</td>
            <td nzAlign="center">{{ data.modelName || '-' }}</td>
            <td nzAlign="center">{{ data.status | machineInspectionStatus }}</td>
            <td nzAlign="center">
              {{ data.interruptRemarks || '-' }}
              <button nz-button nzType="link" (click)="showReasonModal(data)" *ngIf="data.status == 1">添加信息</button>
            </td>
            <td nzAlign="center">{{ data.price || '0' }}</td>
            <td nzAlign="center">{{ data.aprc || '-' }}</td>
            <td nzAlign="center">{{ data.updateTime || '-' }}</td>
            <td nzAlign="center">
              <a nz-button nzType="link" target="_blank" [routerLink]="['/used-store/usedDeviceList']" [queryParams]="{ code: data.phoneCode }">查看机器信息</a>
              <button nz-button nzType="link" (click)="jumpReport(2, data)" *ngIf="[3, 5].includes(data.status)">编辑验机报告</button>
              <button nz-button nzType="link" (click)="showReportModal(data)" *ngIf="data.status == 3">查看验机报告</button>
              <button
                *ngIf="permission.userPermission.has('aisi-recyc:loveOrderManage:continueMachine') && [1, 2, 4].includes(data.status)"
                nz-button
                nzType="link"
                (click)="jumpReport(1, data)">
                继续验机
              </button>
            </td>
          </tr>
        </ng-container>
      </tbody>
    </nz-table>

    <ng-container *ngIf="machineDetailsTable.length">
      <p class="sum-p">验机总价：{{ machineReduce(machineDetailsTable) }}</p>
      <p class="sum-p" *ngIf="orderDetailsData?.couponName && orderDetailsData?.aprc">
        {{ orderDetailsData?.couponName }}：{{ machineMakeupSum() }}
      </p>
      <p class="sum-p">下单抽奖：{{ orderDetailsData.cprc || '0' }}</p>
      <p class="sum-p">验机合计：<b>{{ machineReduce(machineDetailsTable) + machineMakeupSum() + (orderDetailsData.cprc || 0) }}</b></p>
    </ng-container>

    <!-- 订单状态**待确认交易显示 -->
    <div class="test-btns" *ngIf="orderDetailsData?.ostat == 15">
      <button nz-button nzType="default" (click)="machineOpera(0)">不卖了</button>
      <button nz-button nzType="primary" class="m-l-10" (click)="machineOpera(1)">立即收钱</button>
    </div>

    <!-- 继续回收：(待退回状态)、反悔退货：(待打款、打款成功) -->
    <div class="order-back-wrap p-t-10">
      <div *ngIf="orderDetailsData.ostat === 22">
        <span class="order-back-tip">{{ returnTextFilter() }}</span>
        <button
          nz-button
          nzType="primary"
          (click)="backOffShowModal(1)">
          继续回收
        </button>
      </div>
      
      <button
        *ngIf="[16, 19].includes(orderDetailsData.ostat)"
        nz-button
        nzType="primary"
        nzDanger
        (click)="backOffShowModal(2)">
        反悔退货
      </button>
    </div>
  </div>
</nz-card>
<!-- 机器验机详情 END -->

<!-- 退货信息 START -->
<nz-card [nzSize]="cardSize" class="m-b-2">
  <div class="back-goods-wrap">
    <nz-descriptions
      nzTitle="退货信息"
      [nzBordered]="false"
      nzSize="small"
      [nzColumn]="1"
      [nzExtra]="extraTemplate">
      <nz-descriptions-item nzTitle="退货原因">{{ orderDetailsData.backRemarks || '-' }}</nz-descriptions-item>
      <nz-descriptions-item nzTitle="退货地址">
        <ng-container *ngIf="orderDetailsData.backLnker || orderDetailsData.backLnktel || orderDetailsData.backExparea;else templateDz">
          {{ orderDetailsData.backLnker }} {{ orderDetailsData.backLnktel }} {{ orderDetailsData.backExparea }} {{ orderDetailsData?.backExpdtl }}
        </ng-container>
        <ng-template #templateDz>-</ng-template>
      </nz-descriptions-item>
      <nz-descriptions-item nzTitle="退货物流">
        <ng-container *ngIf="orderDetailsData.expno;else templateExpno">{{ orderDetailsData.rtnexpno || '-' }}</ng-container>
        <ng-template #templateExpno>
          <!-- <button nz-button nzType="link">填写物流单号</button> -->
        </ng-template>
      </nz-descriptions-item>
    </nz-descriptions>
    <ng-template #extraTemplate>
      <button
        nz-button
        nzType="link"
        (click)="showReturnInfoModal()"
        [disabled]="[2].includes(orderDetailsData.isResultGoods)">
        添加/编辑退货信息
      </button>
      <nz-divider nzType="vertical"></nz-divider>
      <!-- 状态为待退回且有退货信息 -->
      <a
        [disabled]="!(orderDetailsData.backLnker && [22].includes(orderDetailsData.ostat)) || [2].includes(orderDetailsData.isResultGoods)"
        nz-button
        nzType="link"
        nzDanger
        nz-popconfirm
        nzPopconfirmTitle="确认生成出库单?"
        (nzOnConfirm)="warehouseConfirm()">
        生成出库单
      </a>
    </ng-template>
  </div>
</nz-card>
<!-- 退货信息 END -->

<!-- 商品信息 START -->
<nz-card [nzSize]="cardSize" class="m-b-2">
  <p class="card-p">
    <span>
      商品信息
      <nz-tag nzColor="error">靓机</nz-tag>
    </span>
  </p>

  <div class="good-table-wrap">
    <ng-container *ngIf="orderDetailsData?.renewalSource === 1; else elsegdTemplate">
      <!-- 配件 -->
      <nz-table
        #esgoodTable
        nzSize="small"
        nzBordered
        [nzShowPagination]="false"
        [nzData]="goodsTableData">
        <thead>
          <tr>
            <th nzAlign="left">商品信息</th>
            <th nzAlign="center">购买数量</th>
            <th nzAlign="center">购买单价</th>
            <th nzAlign="center">小计</th>
            <th nzAlign="center">
              优惠小计
              <i nz-icon nzType="exclamation-circle" nzTheme="outline" nz-tooltip nzTooltipTitle="优惠小计是根据优惠总额均摊到每个符合优惠的商品上的"></i>
            </th>
            <th nzAlign="center">售后中数量</th>
            <th nzAlign="center">已退货数量</th>
            <th nzAlign="center">已售后数量</th>
          </tr>
        </thead>
        <tbody>
          <ng-container *ngFor="let item of esgoodTable.data">
            <tr style="background-color: #fbfbfb;">
              <td colSpan="8">
                <b>{{ item?.groupName || '-' }}</b>
              </td>
            </tr>
            <tr *ngFor="let data of item?.list">
              <!-- 商品信息 -->
              <td nzAlign="center">
                <div class="goods-category">
                  <span class="img-box">
                    <img nz-image [nzSrc]="data.groupIcon" [nzFallback]="fallback" alt="" />
                  </span>
                  <span class="goods-name">{{ data.goodsName || '-' }}</span>
                </div>
              </td>
              <!-- 购买数量 -->
              <td nzAlign="center">
                {{ data.num || '0' }}
              </td>
              <!-- 购买单价 -->
              <td nzAlign="center">
                {{ data.price || '0' }}
              </td>
              <!-- 小计 -->
              <td nzAlign="center">
                {{ (data.num || 0) * (data.price || 0) }}
              </td>
              <!-- 优惠小计 -->
              <td nzAlign="center">{{ data.favorablePrice || '0' }}</td>
              <!-- 售后中数量 -->
              <td nzAlign="center">{{ data.afterSaleNum || '0' }}</td>
              <!-- 已退货数量 -->
              <td nzAlign="center">{{ data.returnNum || '0' }}</td>
              <!-- 已售后数量 -->
              <td nzAlign="center">{{ data.returnTotal || '0' }}</td>
            </tr>
          </ng-container>

          <tr *ngIf="goodsTableData.length">
            <td nzAlign="right" colSpan="8">
              <div class="good-table-ft">
                <a
                  nz-button
                  nzType="link"
                  target="_blank"
                  [routerLink]="['/order/accDetails', goodsInfos?.order?.id]"
                >查看靓机订单>></a>

                <dl class="statistics-dl">
                  <dd>运费：￥{{ goodsInfos?.order?.expressPrice }}</dd>
                  <dd>爱豆：￥{{ goodsInfos?.order?.aiDouAmount }}</dd>
                  <dd>运费优惠：￥{{ goodsInfos?.order?.favorablePostage }}</dd>
                  <dd>商家对公转账专属优惠：￥{{ goodsInfos?.order?.transferFavorablePrice }}</dd>
                  <dt>实际总额：<span>￥{{ goodsInfos?.order?.realPrice }}</span></dt>
                </dl>
              </div>
            </td>
          </tr>
        </tbody>
      </nz-table>
    </ng-container>

    <ng-template #elsegdTemplate>
      <!-- 二手 -->
      <nz-table
        #esgoodTable
        nzSize="small"
        nzBordered
        [nzShowPagination]="false"
        [nzData]="goodsTableData">
        <thead>
          <tr>
            <th nzAlign="left">商品信息</th>
            <th nzAlign="center">机器编码</th>
            <th nzAlign="center">IMEI</th>
            <th nzAlign="center">序列号</th>
            <th nzAlign="center">购买单价</th>
            <th nzAlign="center">
              优惠金额
              <i nz-icon nzType="exclamation-circle" nzTheme="outline" nz-tooltip nzTooltipTitle="优惠小计是根据优惠总额均摊到每个符合优惠的商品上"></i>
            </th>
            <!-- <th nzAlign="center">已售后</th> -->
            <th nzAlign="center">售后次数</th>
            <th nzAlign="center">已退货</th>
          </tr>
        </thead>
        <tbody>
          <tr *ngFor="let data of esgoodTable.data">
            <!-- 商品信息 -->
            <td nzAlign="left">
              <div class="goods-category">
                <span class="img-box">
                  <img nz-image [nzSrc]="data.icon" [nzFallback]="fallback" alt="" />
                </span>
                <span class="goods-name">{{ data.goodsName || '-' }}</span>
              </div>
            </td>
            <!-- 机器编码 -->
            <td nzAlign="center">{{ data.equipmentCode || '-' }}</td>
            <!-- IMEI -->
            <td nzAlign="center">{{ data.imei || '-' }}</td>
            <!-- 序列号 -->
            <td nzAlign="center">{{ data.serialNumber || '-' }}</td>
            <!-- 购买单价 -->
            <td nzAlign="center">￥ {{ data.price || '0' }}</td>
            <!-- 优惠金额 -->
            <td nzAlign="center">￥ {{ data.favorablePrice || '0' }}</td>
            <!-- <td nzAlign="center">
              {{ (data.afterSaleNum && data.status == 9) ? '是' : '否' }}
            </td> -->
            <!-- 售后次数 -->
            <td nzAlign="center">{{ data.returnTotal || '0' }}</td>
            <!-- 已退货 -->
            <td nzAlign="center">
              <span [ngStyle]="{'color': data.returnNum ? '#52c41a' : '#ff4d4f'}">
                {{ data.returnNum ? '是' : '否' }}
              </span>
            </td>
          </tr>

          <tr *ngIf="goodsTableData.length">
            <td nzAlign="right" colSpan="8">
              <div class="good-table-ft">
                <a
                  nz-button
                  nzType="link"
                  target="_blank"
                  routerLink="/used-store/usedOrderDetails"
                  [queryParams]="{id: goodsInfos?.order?.id}"
                >查看靓机订单>></a>

                <dl class="statistics-dl">
                  <dd>运费：￥{{ goodsInfos?.order?.expressPrice }}</dd>
                  <dd>爱豆：￥{{ goodsInfos?.order?.aiDouAmount }}</dd>
                  <dt>实收总额：<span>￥{{ (goodsInfos?.order?.realPrice || 0) + (goodsInfos?.order?.expressPrice || 0) }}</span></dt>
                </dl>
              </div>
            </td>
          </tr>
        </tbody>
      </nz-table>
    </ng-template>
  </div>
</nz-card>
<!-- 商品信息 END -->

<!-- 跟进记录Table START -->
<nz-card [nzSize]="cardSize">
  <p class="card-p">
    跟进记录
    <button nz-button nzType="link" (click)="showFollowModal()">跟进</button>
  </p>
  
  <div class="follow-table">
    <nz-table
      #followTable
      nzSize="small"
      nzBordered
      nzHideOnSinglePage
      nzShowQuickJumper
      nzShowSizeChanger
      [nzShowPagination]="true"
      [nzData]="followTableData">
      <thead>
        <tr>
          <th nzAlign="center" nzWidth="120px">ID</th>
          <th nzAlign="center" nzWidth="150px">跟进人</th>
          <th nzAlign="center" nzWidth="180px">跟进时间</th>
          <th nzAlign="center">跟进内容</th>
          <th nzAlign="center">备注</th>
        </tr>
      </thead>
      <tbody>
        <tr *ngFor="let data of followTable.data">
          <td nzAlign="center">{{ data.id }}</td>
          <td nzAlign="center">{{ data.follower || '-' }}</td>
          <td nzAlign="center">{{ data.createTime || '-' }}</td>
          <td nzAlign="center">{{ data.content || '-' }}</td>
          <td nzAlign="center">{{ data.remarks || '-' }}</td>
      </tbody>
    </nz-table>
  </div>
</nz-card>
<!-- 跟进记录Table END -->

<!-- Modal 爱思用户信息 -->
<app-user-info-modal #userInfoRef [userId]="orderDetailsData.userId"></app-user-info-modal>

<!-- 添加/修改收款信息 START -->
<nz-modal
  nzClassName="custom-model-wrap"
  [nzFooter]="null"
  [(nzVisible)]="isCollectionVisible"
  nzTitle="添加/修改收款信息"
  (nzOnCancel)="collectionCancel()">

  <div *nzModalContent>
    <div class="custom-model-body">
      <!-- body START -->
      <form nz-form class="form-modal-body" [formGroup]="collectionForm">
        <nz-form-item>
          <nz-form-label nzSpan="6" nzRequired>收款账号</nz-form-label>
          <nz-form-control nzSpan="18" nzErrorTip="请输入收款账号!">
            <input formControlName="payacc" nz-input placeholder="请输入收款账号" />
          </nz-form-control>
        </nz-form-item>

        <!-- <nz-form-item>
          <nz-form-label nzSpan="6" nzRequired>账户类型</nz-form-label>
          <nz-form-control nzSpan="18" nzErrorTip="请选择账户类型!">
            <nz-select nzShowSearch nzAllowClear nzPlaceHolder="请选择账户类型" formControlName="payway">
              <nz-option nzLabel="支付宝" [nzValue]="121"></nz-option>
              <nz-option nzLabel="微信" [nzValue]="111"></nz-option>
            </nz-select>
          </nz-form-control>
        </nz-form-item> -->

        <nz-form-item>
          <nz-form-label nzSpan="6" nzRequired>收款人姓名</nz-form-label>
          <nz-form-control nzSpan="18" nzErrorTip="请输入收款人姓名!">
            <input formControlName="payname" nz-input placeholder="请输入收款人姓名" />
          </nz-form-control>
        </nz-form-item>

        <nz-form-item>
          <nz-form-label nzSpan="6" nzRequired>备注</nz-form-label>
          <nz-form-control nzSpan="18" nzErrorTip="请输入备注原因!">
            <nz-textarea-count [nzMaxCharacterCount]="150">
              <textarea rows="4" maxlength="150" formControlName="remarks" nz-input placeholder="请输入修改/添加收款信息的原因（必填）"></textarea>
            </nz-textarea-count>
          </nz-form-control>
        </nz-form-item>
      </form>
      <!-- body END -->
    </div>

    <div class="custom-model-foot">
      <div class="custom-foot-cont">
        <button nz-button nzType="primary" (click)="submitCollection()">确定</button>
        <button nz-button nzType="default" (click)="collectionCancel()">取消</button>
      </div>
    </div>
  </div>
</nz-modal>
<!-- 添加/修改收款信息 END -->

<!-- 打款失败 START -->
<nz-modal
  nzClassName="custom-model-wrap"
  [nzFooter]="null"
  [(nzVisible)]="isPaymentVisible"
  nzTitle="打款失败"
  (nzOnCancel)="paymentCancel()">

  <div *nzModalContent>
    <div class="custom-model-body">
      <!-- body START -->
      <form nz-form class="form-modal-body" [formGroup]="paymentForm">
        <p class="payment-tips">是否确定要将订单改为打款失败状态？</p>
        <nz-form-item>
          <nz-form-label nzSpan="7" nzRequired>打款失败原因</nz-form-label>
          <nz-form-control nzSpan="17" nzErrorTip="请选择打款失败原因!">
            <nz-select nzShowSearch nzAllowClear nzPlaceHolder="请选择打款失败原因" formControlName="type" (ngModelChange)="reasonChange($event)">
              <nz-option
                *ngFor="let item of paymentReasons"
                [nzLabel]="item.label"
                [nzValue]="item.value">
              </nz-option>
            </nz-select>
          </nz-form-control>
        </nz-form-item>
      </form>
      <!-- body END -->
    </div>

    <div class="custom-model-foot">
      <div class="custom-foot-cont">
        <button nz-button nzType="primary" (click)="paymentOperation(0)">确定</button>
        <button nz-button nzType="default" (click)="paymentCancel()">取消</button>
      </div>
    </div>
  </div>
</nz-modal>
<!-- 打款失败 END -->

<!-- 不卖退款 START -->
<nz-modal
  nzClassName="custom-model-wrap"
  [nzFooter]="null"
  [(nzVisible)]="isReturnGoodsVisible"
  nzTitle="退货"
  (nzOnCancel)="machineCancel()">

  <div *nzModalContent>
    <div class="custom-model-body">
      <!-- body START -->
      <form nz-form class="form-modal-body" [formGroup]="returnGoodsForm">
        <nz-form-item>
          <nz-form-label nzSpan="5" nzRequired>退货原因</nz-form-label>
          <nz-form-control nzSpan="19" nzErrorTip="请选择退货原因!">
            <nz-select nzShowSearch nzAllowClear nzPlaceHolder="请选择退货原因" formControlName="backRemarks">
              <nz-option nzLabel="价格过低，无法接受" nzValue="价格过低，无法接受"></nz-option>
              <nz-option nzLabel="对验机报告有疑问" nzValue="对验机报告有疑问"></nz-option>
              <nz-option nzLabel="担心交易安全及隐私泄露" nzValue="担心交易安全及隐私泄露"></nz-option>
              <nz-option nzLabel="不想卖了，另有他用" nzValue="不想卖了，另有他用"></nz-option>
              <nz-option nzLabel="机器不符合回收条件，只能退回" nzValue="机器不符合回收条件，只能退回"></nz-option>
              <nz-option nzLabel="其他原因" nzValue="其他原因"></nz-option>
            </nz-select>
          </nz-form-control>
        </nz-form-item>

        <nz-form-item>
          <nz-form-label nzSpan="5" nzRequired>收货人</nz-form-label>
          <nz-form-control nzSpan="19" nzErrorTip="请输入收货人!">
            <input nz-input placeholder="请输入收货人" formControlName="backLnker" />
          </nz-form-control>
        </nz-form-item>

        <nz-form-item>
          <nz-form-label nzSpan="5" nzRequired>手机号码</nz-form-label>
          <nz-form-control nzSpan="19" nzErrorTip="请输入手机号码!">
            <input nz-input placeholder="请输入手机号码" formControlName="backLnktel" />
          </nz-form-control>
        </nz-form-item>

        <nz-form-item>
          <nz-form-label nzSpan="5" nzRequired>退货地址</nz-form-label>
          <nz-form-control nzSpan="19" nzErrorTip="请选择退货地址!">
            <nz-cascader [nzLoadData]="loadTreeData" formControlName="backI5addrid" nzPlaceHolder="请选择地址" (ngModelChange)="onChanges($event)"></nz-cascader>
          </nz-form-control>
        </nz-form-item>

        <nz-form-item>
          <nz-form-label nzSpan="5" nzRequired>详细地址</nz-form-label>
          <nz-form-control nzSpan="19" nzErrorTip="请输入详细地址!">
            <div>
              <textarea rows="4" formControlName="backExpdtl" nz-input placeholder="详细地址"></textarea>
            </div>
          </nz-form-control>
        </nz-form-item>

        <nz-form-item>
          <nz-form-label nzSpan="5" nzRequired>备注</nz-form-label>
          <nz-form-control nzSpan="19" nzErrorTip="请输入操作备注!">
            <nz-textarea-count [nzMaxCharacterCount]="150">
              <textarea rows="4" maxlength="150" formControlName="remarks" nz-input placeholder="请输入操作备注（必填）"></textarea>
            </nz-textarea-count>
          </nz-form-control>
        </nz-form-item>
      </form>
      <!-- body END -->
    </div>

    <div class="custom-model-foot">
      <div class="custom-foot-cont">
        <button nz-button nzType="primary" [nzLoading]="returnSubLoading" (click)="submitReturnGoods()">确定</button>
        <button nz-button nzType="default" (click)="machineCancel()">取消</button>
      </div>
    </div>
  </div>
</nz-modal>
<!-- 不卖退款 END -->

<!-- 立即收钱 START -->
<nz-modal
  nzClassName="custom-model-wrap"
  [nzFooter]="null"
  [(nzVisible)]="isMachineVisible"
  nzTitle="提示"
  (nzOnCancel)="machineCancel()">

  <div *nzModalContent>
    <div class="custom-model-body">
      <p class="machine-p">
        是否要选择 <span style="color: #ff4d4f;">{{ machineType == 0 ? '不卖了' : '立即收钱' }}</span> ？
        确认后用户将收到 ¥{{ machineReduce(machineDetailsTable) + machineMakeupSum() + (orderDetailsData.cprc || 0) }}
      </p>
      <!-- body START -->
      <form nz-form class="form-modal-body" [formGroup]="machineForm">
        <nz-form-item>
          <nz-form-label nzSpan="5" nzRequired>备注</nz-form-label>
          <nz-form-control nzSpan="19" nzErrorTip="请输入操作备注!">
            <nz-textarea-count [nzMaxCharacterCount]="150">
              <textarea rows="4" maxlength="150" formControlName="remarks" nz-input placeholder="请输入操作备注（必填）"></textarea>
            </nz-textarea-count>
          </nz-form-control>
        </nz-form-item>
      </form>
      <!-- body END -->
    </div>

    <div class="custom-model-foot">
      <div class="custom-foot-cont">
        <button nz-button nzType="primary" (click)="submitMachine()">确定</button>
        <button nz-button nzType="default" (click)="machineCancel()">取消</button>
      </div>
    </div>
  </div>
</nz-modal>
<!-- 立即收钱 END -->

<!-- 添加跟进 START -->
<nz-modal
  nzClassName="custom-model-wrap"
  [nzFooter]="null"
  [(nzVisible)]="isFollowVisible"
  nzTitle="跟进"
  (nzOnCancel)="followCancel()">

  <div *nzModalContent>
    <div class="custom-model-body">
      <!-- body START -->
      <form nz-form class="form-modal-body" [formGroup]="followForm">
        <nz-form-item>
          <nz-form-label nzSpan="5" nzRequired>备注</nz-form-label>
          <nz-form-control nzSpan="19" nzErrorTip="请输入跟进内容!">
            <nz-textarea-count [nzMaxCharacterCount]="150">
              <textarea rows="4" maxlength="150" formControlName="remarks" nz-input placeholder="请输入跟进内容（必填）"></textarea>
            </nz-textarea-count>
          </nz-form-control>
        </nz-form-item>
      </form>
      <!-- body END -->
    </div>

    <div class="custom-model-foot">
      <div class="custom-foot-cont">
        <button nz-button nzType="primary" (click)="submitFollow()">确定</button>
        <button nz-button nzType="default" (click)="followCancel()">取消</button>
      </div>
    </div>
  </div>
</nz-modal>
<!-- 添加跟进 END -->

<!-- 物流详情 START -->
<nz-modal
  [nzFooter]="null"
  [(nzVisible)]="isLogisticsVisible"
  nzTitle="物流详情"
  (nzOnCancel)="handleCancel()">
  <ng-container *nzModalContent>
    <div class="">
      <nz-timeline>
        <ng-container *ngFor="let item of logisticsLists">
          <nz-timeline-item>
            <dl class="logistics-dl">
              <dt *ngIf="item.name">{{ item.name || '---' }}</dt>
              <dd *ngIf="item.date">{{ item.date || '---' }}</dd>
            </dl>
          </nz-timeline-item>
        </ng-container>
      </nz-timeline>
    </div>
  </ng-container>
</nz-modal>
<!-- 物流详情 END -->

<!-- 评估详情 -->
<assessment-details-modal #detailRef [optionParams]="previewParams"></assessment-details-modal>

<!-- 验机详情--原因添加信息 START -->
<nz-modal
  nzClassName="custom-model-wrap"
  [nzFooter]="null"
  [(nzVisible)]="isReasonVisible"
  nzTitle="添加信息"
  (nzOnCancel)="isReasonVisible = false">

  <div *nzModalContent>
    <div class="custom-model-body">
      <!-- body START -->
      <form nz-form class="form-modal-body" [formGroup]="reasonForm">
        <nz-form-item>
          <nz-form-label nzSpan="5" nzRequired>备注</nz-form-label>
          <nz-form-control nzSpan="19" nzErrorTip="请输入内容!">
            <nz-textarea-count [nzMaxCharacterCount]="150">
              <textarea rows="4" maxlength="150" formControlName="remarks" nz-input placeholder="请输入内容（必填）"></textarea>
            </nz-textarea-count>
          </nz-form-control>
        </nz-form-item>
      </form>
      <!-- body END -->
    </div>

    <div class="custom-model-foot">
      <div class="custom-foot-cont">
        <button nz-button nzType="primary" (click)="submitReason()">确定</button>
        <button nz-button nzType="default" (click)="isReasonVisible = false">取消</button>
      </div>
    </div>
  </div>
</nz-modal>
<!-- 验机详情--原因添加信息 END -->

<!-- S 取消订单 -->
<nz-modal
  nzClassName="custom-model-wrap"
  [nzFooter]="null"
  [(nzVisible)]="isCancelVisible"
  nzTitle="确认取消订单?"
  (nzOnCancel)="orderCancel()">

  <div *nzModalContent>
    <div class="custom-model-body">
      <!-- body START -->
      <form nz-form class="form-modal-body" [formGroup]="cancelOrderForm">
        <nz-form-item>
          <nz-form-label nzSpan="5" nzRequired>备注</nz-form-label>
          <nz-form-control nzSpan="19" nzErrorTip="请输入内容!">
            <nz-textarea-count [nzMaxCharacterCount]="150">
              <textarea rows="4" maxlength="150" formControlName="note" nz-input placeholder="请输入内容（必填）"></textarea>
            </nz-textarea-count>
          </nz-form-control>
        </nz-form-item>
      </form>
      <!-- body END -->
    </div>

    <div class="custom-model-foot">
      <div class="custom-foot-cont">
        <button nz-button nzType="primary" (click)="submitCancelOrder()">确定</button>
        <button nz-button nzType="default" (click)="orderCancel()">取消</button>
      </div>
    </div>
  </div>
</nz-modal>
<!-- E 取消订单 -->

<!-- S 验机报告 -->
<machine-report-modal #reportModalRef></machine-report-modal>
<!-- E 验机报告 -->

<!-- S 添加退货信息 -->
<nz-modal
  nzClassName="custom-model-wrap"
  [nzFooter]="null"
  [(nzVisible)]="isReturnInfoVisible"
  nzTitle="添加/编辑退货信息"
  (nzOnCancel)="returnInfoCancel()">

  <div *nzModalContent>
    <div class="custom-model-body">
      <!-- body START -->
      <form nz-form class="form-modal-body" [formGroup]="returnInfosForm">
        <nz-form-item>
          <nz-form-label nzSpan="5" nzRequired>退货数量</nz-form-label>
          <nz-form-control nzSpan="19" [nzErrorTip]="'请输入退货数量'">
            <nz-input-number
              style="width: 100%;"
              [nzMin]="1"
              [nzStep]="1"
              [nzPrecision]="0"
              [nzPlaceHolder]="'请输入退货数量'"
              formControlName="resultQuantity">
            </nz-input-number>
          </nz-form-control>
        </nz-form-item>

        <nz-form-item>
          <nz-form-label nzSpan="5" nzRequired>邮费承担</nz-form-label>
          <nz-form-control nzSpan="19" nzErrorTip="请选择邮费承担!">
            <nz-radio-group formControlName="isFreight">
              <label nz-radio [nzValue]="0">我司承担</label>
              <label nz-radio [nzValue]="1">用户承担</label>
            </nz-radio-group>
          </nz-form-control>
        </nz-form-item>

        <nz-form-item>
          <nz-form-label nzSpan="5" nzRequired>收货人</nz-form-label>
          <nz-form-control nzSpan="19" nzErrorTip="请输入收货人!">
            <input nz-input placeholder="请输入收货人" formControlName="backLnker" />
          </nz-form-control>
        </nz-form-item>

        <nz-form-item>
          <nz-form-label nzSpan="5" nzRequired>手机号码</nz-form-label>
          <nz-form-control nzSpan="19" nzErrorTip="请输入手机号码!">
            <input nz-input [maxLength]="11" placeholder="请输入手机号码" formControlName="backLnktel" />
          </nz-form-control>
        </nz-form-item>

        <nz-form-item>
          <nz-form-label nzSpan="5" nzRequired>退货地址</nz-form-label>
          <nz-form-control nzSpan="19" nzErrorTip="请选择退货地址!">
            <nz-cascader [nzLoadData]="loadTreeData" formControlName="backI5addrid" nzPlaceHolder="请选择地址" (ngModelChange)="onChanges($event)"></nz-cascader>
          </nz-form-control>
        </nz-form-item>

        <nz-form-item>
          <nz-form-label nzSpan="5" nzRequired>详细地址</nz-form-label>
          <nz-form-control nzSpan="19" nzErrorTip="请输入详细地址!">
            <div>
              <textarea rows="4" formControlName="backExpdtl" nz-input placeholder="详细地址"></textarea>
            </div>
          </nz-form-control>
        </nz-form-item>
      </form>
      <!-- body END -->
    </div>

    <div class="custom-model-foot">
      <div class="custom-foot-cont">
        <button nz-button nzType="primary" (click)="submitReturnInfos()">确定</button>
        <button nz-button nzType="default" (click)="returnInfoCancel()">取消</button>
      </div>
    </div>
  </div>
</nz-modal>
<!-- S 添加退货信息 -->

<!-- S 继续回收 -->
<nz-modal
  nzClassName="custom-model-wrap"
  [nzFooter]="null"
  [(nzVisible)]="isContinueVisible"
  nzTitle="继续回收"
  (nzOnCancel)="continueRegretCancel(0)">

  <div *nzModalContent>
    <div class="custom-model-body">
      <!-- body START -->
      <p class="backoff-tips">※ 当前处于 <b>待退回</b> 状态，是否修改为继续回收?</p>
      <form nz-form class="form-modal-body" [formGroup]="continueOrderForm">
        <nz-form-item>
          <nz-form-label nzSpan="5" nzRequired>备注</nz-form-label>
          <nz-form-control nzSpan="19" nzErrorTip="请输入备注!">
            <nz-textarea-count [nzMaxCharacterCount]="150">
              <textarea rows="4" maxlength="150" formControlName="remark" nz-input placeholder="请输入备注（必填）"></textarea>
            </nz-textarea-count>
          </nz-form-control>
        </nz-form-item>
      </form>
      <!-- body END -->
    </div>

    <div class="custom-model-foot">
      <div class="custom-foot-cont">
        <button nz-button nzType="primary" (click)="continueRecycling()">确定回收</button>
        <button nz-button nzType="default" (click)="continueRegretCancel(0)">取消</button>
      </div>
    </div>
  </div>
</nz-modal>
<!-- E 继续回收 -->

<!-- S 反悔退货 -->
<nz-modal
  nzClassName="custom-model-wrap"
  [nzFooter]="null"
  [(nzVisible)]="isRegretVisible"
  nzTitle="反悔退货"
  (nzOnCancel)="continueRegretCancel(1)">

  <div *nzModalContent>
    <div class="custom-model-body">
      <!-- body START -->
      <ng-container *ngIf="orderDetailsData.ostat === 16;else templateTips">
        <p class="backoff-tips">※ 当前订单处于<b>待打款</b>状态，是否要反悔退货?</p>
      </ng-container>
      <ng-template #templateTips>
        <p class="backoff-tips">※ 当前订单处于<b>打款完成</b>状态，请确保用户已退还款项，方可反悔退货!</p>
      </ng-template>
      
      <form nz-form class="form-modal-body" [formGroup]="regretOrderForm">
        <nz-form-item>
          <nz-form-label nzSpan="5" nzRequired>退货数量</nz-form-label>
          <nz-form-control nzSpan="19" [nzErrorTip]="'请输入退货数量'">
            <nz-input-number
              style="width: 100%;"
              [nzMin]="1"
              [nzStep]="1"
              [nzPrecision]="0"
              [nzPlaceHolder]="'请输入退货数量'"
              formControlName="resultQuantity">
            </nz-input-number>
          </nz-form-control>
        </nz-form-item>

        <nz-form-item>
          <nz-form-label nzSpan="5" nzRequired>邮费承担</nz-form-label>
          <nz-form-control nzSpan="19" nzErrorTip="请选择邮费承担!">
            <nz-radio-group formControlName="isFreight">
              <label nz-radio [nzValue]="0">我司承担</label>
              <label nz-radio [nzValue]="1">用户承担</label>
            </nz-radio-group>
          </nz-form-control>
        </nz-form-item>

        <nz-form-item>
          <nz-form-label nzSpan="5" nzRequired>退货原因</nz-form-label>
          <nz-form-control nzSpan="19" nzErrorTip="请选择退货原因!">
            <nz-select nzShowSearch nzAllowClear nzPlaceHolder="请选择退货原因" formControlName="backRemarks">
              <nz-option nzLabel="价格过低，无法接受" nzValue="价格过低，无法接受"></nz-option>
              <nz-option nzLabel="对验机报告有疑问" nzValue="对验机报告有疑问"></nz-option>
              <nz-option nzLabel="担心交易安全及隐私泄露" nzValue="担心交易安全及隐私泄露"></nz-option>
              <nz-option nzLabel="不想卖了，另有他用" nzValue="不想卖了，另有他用"></nz-option>
              <nz-option nzLabel="机器不符合回收条件，只能退回" nzValue="机器不符合回收条件，只能退回"></nz-option>
              <nz-option nzLabel="其他原因" nzValue="其他原因"></nz-option>
            </nz-select>
          </nz-form-control>
        </nz-form-item>

        <nz-form-item>
          <nz-form-label nzSpan="5" nzRequired>收货人</nz-form-label>
          <nz-form-control nzSpan="19" nzErrorTip="请输入收货人!">
            <input nz-input placeholder="请输入收货人" formControlName="backLnker" />
          </nz-form-control>
        </nz-form-item>

        <nz-form-item>
          <nz-form-label nzSpan="5" nzRequired>手机号码</nz-form-label>
          <nz-form-control nzSpan="19" nzErrorTip="请输入手机号码!">
            <input nz-input placeholder="请输入手机号码" formControlName="backLnktel" />
          </nz-form-control>
        </nz-form-item>

        <nz-form-item>
          <nz-form-label nzSpan="5" nzRequired>退货地址</nz-form-label>
          <nz-form-control nzSpan="19" nzErrorTip="请选择退货地址!">
            <nz-cascader
              [nzLoadData]="loadTreeData"
              nzPlaceHolder="请选择地址"
              formControlName="backI5addrid"
              (ngModelChange)="onChanges($event)">
            </nz-cascader>
          </nz-form-control>
        </nz-form-item>

        <nz-form-item>
          <nz-form-label nzSpan="5" nzRequired>详细地址</nz-form-label>
          <nz-form-control nzSpan="19" nzErrorTip="请输入详细地址!">
            <div>
              <textarea rows="4" nz-input placeholder="详细地址" formControlName="backExpdtl"></textarea>
            </div>
          </nz-form-control>
        </nz-form-item>

        <nz-form-item>
          <nz-form-label nzSpan="5" nzRequired>备注</nz-form-label>
          <nz-form-control nzSpan="19" nzErrorTip="请输入备注!">
            <nz-textarea-count [nzMaxCharacterCount]="150">
              <textarea rows="4" maxlength="150" formControlName="note" nz-input placeholder="请输入备注（必填）"></textarea>
            </nz-textarea-count>
          </nz-form-control>
        </nz-form-item>
      </form>
      <!-- body END -->
    </div>

    <div class="custom-model-foot">
      <div class="custom-foot-cont">
        <button nz-button nzType="primary" (click)="refundOrderGoods()">确定退货</button>
        <button nz-button nzType="default" (click)="continueRegretCancel(1)">取消</button>
      </div>
    </div>
  </div>
</nz-modal>
<!-- E 反悔退货 -->

<!-- S 关闭订单 Modal -->
<nz-modal
  nzClassName="custom-model-wrap"
  [nzFooter]="null"
  [(nzVisible)]="closeOrderVisisble"
  [nzTitle]="'关闭订单'"
  (nzOnCancel)="closeOrderVisisble = false">

  <div *nzModalContent>
    <div class="custom-model-body">
      <nz-form-item>
        <nz-form-label nzSpan="4" nzRequired>备注</nz-form-label>
        <nz-form-control nzSpan="20" nzErrorTip="请输入备注!">
          <nz-textarea-count [nzMaxCharacterCount]="150">
            <textarea
              rows="4"
              maxlength="150"
              nz-input
              placeholder="请输入关闭原因"
              [(ngModel)]="closeOrderRemark"
            ></textarea>
          </nz-textarea-count>
        </nz-form-control>
      </nz-form-item>
    </div>

    <div class="custom-model-foot">
      <div class="custom-foot-cont">
        <button nz-button nzType="default" (click)="closeOrderVisisble = false">取消</button>
        <button nz-button nzType="primary" [nzLoading]="closeOrderLoading" (click)="subCloseOrder()">确定</button>
      </div>
    </div>
  </div>
</nz-modal>
<!-- E 关闭订单 Modal -->

<!-- S 发送短信 -->
<nz-modal
  nzClassName="custom-model-wrap"
  [nzFooter]="null"
  [(nzVisible)]="isSendMsgVisible"
  [nzTitle]="'发送短信'"
  (nzOnCancel)="isSendMsgVisible = false">

  <div *nzModalContent>
    <div class="custom-model-body">
      <nz-form-item>
        <nz-form-label [nzSpan]="4" nzRequired>短信模板</nz-form-label>
        <nz-form-control [nzSpan]="20">
          <nz-select
            nzShowSearch
            nzAllowClear
            nzPlaceHolder="请选择短信模板"
            [(ngModel)]="msgTemplType"
            (ngModelChange)="msgTempChange($event)">
            <nz-option
              *ngFor="let option of shortMsgOptions"
              [nzLabel]="option.key"
              [nzValue]="option.id"
            ></nz-option>
          </nz-select>
        </nz-form-control>
      </nz-form-item>

      <nz-form-item>
        <nz-form-control [nzSpan]="20" nzOffset="4">
          <nz-textarea-count>
            <textarea
              rows="5"
              nz-input
              placeholder="请先选择短信模板"
              readonly
              [(ngModel)]="msgTemplContent"
            ></textarea>
          </nz-textarea-count>
        </nz-form-control>
      </nz-form-item>
    </div>

    <div class="custom-model-foot">
      <div class="custom-foot-cont">
        <button nz-button nzType="default" (click)="isSendMsgVisible = false">取消</button>
        <button nz-button nzType="primary" [nzLoading]="sendMsgLoading" (click)="submitSendMsgData()">确认发送</button>
      </div>
    </div>
  </div>
</nz-modal>
<!-- E 发送短信 -->